@extends('Console.layout')
@section('breadcrumb')
    @parent
    <li class="breadcrumb-item"><a href="{{route('users.console.entities')}}">用户列表</a></li>
    <li class="breadcrumb-item active" aria-current="page">用户详情</li>
@endsection

@section('content-header-menu')
    <a href="{{route('users.console.entities')}}" class="btn  btn-secondary">返回</a>
    <a href="{{route('users.console.view')}}" class="btn  btn-secondary">添加用户</a>
@endsection
@section('content')

    <div class="card">
        <div class="card-header">

        </div>
        <!-- /.box-header -->
        <div class="card-body">

            <form class="" method="POST" action="{{ url()->current() }}">
                {{ csrf_field() }}
                <form-item type="text" data-name="account" data-label="登录名"
                           data-value="{{old('account',$model->account??'')}}"
                           data-error="{{ $errors->first('account') }}"></form-item>

                <form-item type="text" data-name="name" data-label="昵称" data-value="{{old('name',$model->name??'')}}"
                           data-error="{{ $errors->first('name') }}"></form-item>

                <form-item type="password" data-name="password" data-label="密码" data-value=""
                           data-error="{{ $errors->first('password') }}" data-placeholder="不修改请留空"></form-item>

                <form-item type="text" data-name="email" data-label="Email"
                           data-value="{{old('email',$model->email??'')}}"
                           data-error="{{ $errors->first('email') }}"></form-item>

                <form-item type="text" data-name="mobile" data-label="手机"
                           data-value="{{old('mobile',$model->mobile??'')}}"
                           data-error="{{ $errors->first('mobile') }}"></form-item>


                <form-item type="file" data-name="picture" data-label="头像"
                           data-value="{{$model->picture??''}}"
                           data-error="{{ $errors->first('picture') }}"
                           data-files-connector="{{route('files.connector')}}"
                           data-file-preview-url="{{$model->picture_file_url??''}}"
                           data-file-preview-url-thumb="{{$model->picture_file_thumb??''}}"></form-item>

                <form-item type="radio" data-name="sex"  data-label="性别" data-value="{{old('sex',$model->sex??'保密')}}"
                           data-error="{{ $errors->first('sex') }}" v-bind:data-options=@json($sex_options)></form-item>

                <form-item type="textarea" data-name="summary" data-label="简介"
                           data-value="{{old('summary',$model->summary??'')}}"
                           data-error="{{ $errors->first('summary') }}"></form-item>

                <form-item type="checkbox" data-label="所属用户组" data-value="" data-error="{{ $errors->first('roles') }}"
                           v-bind:data-options=@json($role_options)></form-item>


                <form-item type="datetime" data-name="lock_to" data-label="锁定到"
                           data-value="{{old('lock_to',$model->lock_to??'')}}"
                           data-error="{{ $errors->first('lock_to') }}" data-placeholder="不锁定请留空"></form-item>


                <form-item type="radio" data-name="is_super_administrator"  data-label="是否超管" data-value="{{old('is_super_administrator',$model->is_super_administrator??'0')}}"
                           data-error="{{ $errors->first('is_super_administrator') }}" v-bind:data-options=@json($is_super_options)></form-item>

                <div class="form-group mt-3 d-flex justify-content-between">
                    <a href="{{route('users.console.entities')}}" class="btn btn-outline-secondary">Cancel</a>
                    <button type="submit" class="btn btn-primary pull-right">保存</button>
                </div>
            </form>
        </div>
        <!-- /.box-body -->

        <div class="card-footer">

        </div>


    </div>
    <!-- /.box -->

@endsection
